{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.metrics import classification_report  #对模型进行评估\n",
    "from sklearn import preprocessing  #对数据做标准化\n",
    "from sklearn import linear_model\n",
    "#数据是否需要标准化\n",
    "scale =True\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAEACAYAAABBDJb9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt8VOWdP/DPN0QhISTcolKRBKyKIBbkhbJW64Dgarut\n1tYL9ff6uW1WFxUvq1VA6y9YRfHSKu0WxQot3S7oqluwZSsKMqxuW0PBKMqlrEpAWiHIpZs1ckm+\nvz/OTDIJczln5lyec+bzfr3mxUzmzJxnTsj3PPN9vs9zRFVBREThVhJ0A4iIqHAM5kREEcBgTkQU\nAQzmREQRwGBORBQBDOZERBFgO5iLyGAReU1E3hORDSJyS+Ln/UTkFRHZIiIrRKTKu+YSEVE6YrfO\nXEROAHCCqjaKSAWAdQAuBfBtAJ+o6iMiMh1AP1Wd4VmLiYjoKLZ75qr6sao2Ju63ANgEYDCsgL4o\nsdkiAJe53UgiIsrOds+8y4tEagHEAZwBYIeq9kt5bq+q9nepfUREZIPjAdBEiuUFALcmeujdzwZc\nH4CIyGelTjYWkVJYgfxfVHVZ4se7ROR4Vd2VyKvvzvBaBnkiojyoquTaxmnPfCGAjao6N+VnLwH4\n+8T9awEs6/6ilAYZdauvrw+8DWFok6ntYpvYpmJol122e+Yi8kUA1wDYICJvwUqn3A3gYQD/JiLf\nAdAE4ErbeyciIlfYDuaq+l8AemR4epI7zSEionwU9QzQWCwWdBOOYmKbADPbxTbZwzbZZ2q77Mir\nNDGv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z51H7qaiowF//+teOxwcOHEBFRUVebbaLwZyIPHPppRehvPwHAP4E\n4C8oL5+FSy+9qOP5iooKvP76Cowe/W+orByLceNW4D//82X07NmzY5t+/foB2NrxuLR0KwYO7JtX\ne2644QacfvrpeP/997F//37Mnj37qEHPHTt2dNxvamrC5z73OQDASSedhPnz52Pv3r3Yu3cv9u3b\nh5aWFowfP/6o/YwcORJvv/12x+PGxkaMHDkyrzbbZqf77sYNTLMQRVq6v/H29nadPfth7dPnOC0r\n66vXXXezHj582NH7rlmzRsvLB2pp6W3aq9e39Pjjh+quXbscvUcyzXLOOefo/fffr6qqmzZt0tNO\nO03PP//8ju1ERCdNmqT79u3T7du36/Dhw/WZZ55RVdVf/epXesYZZ+h7772nqqr79+/X559/vstr\nk2mWp556SkeMGKE7d+7Ujz76SEeMGKFPP509158pRoI5cyLyk5d/4++9957OmTNH586dq3v27HH8\n+qFDh+qqVav09ddf1+HDh2ufPn30S1/6ktbX13cJ5iUlJfrjH/9Yhw0bpgMHDtQ777xT29vbO57/\n5S9/qaNGjdKqqiodMmSI1tXVdXltMpirqk6fPl379++vAwYM0BkzZuRsY6HBnKsmEpEruGpiYbhq\nIhERMZgTEUUBgzkRUQQwmBMRRQCDORFRBDCYExFFAIM5EVEEMJgTEUUAgzkRRR4vG0dEVETcumxc\nPB7HxIkT0bdvXwwbNsyNpuXEYE5Ewdq8ufO+KrBlS2BNKWQ5gtTX9u7dG3V1dXjsscfcaJYtDOZE\n5J22NiB1ve9PPgFaWjofHzkCXHklcP/9ViCfORO49lqgvd2T5vh12bhx48bhmmuuwdChQz35HOkw\nmBORd9asAcaPB7ZutQL5hRcCixd3Pl9aCrzyivWzkhLg5ZeB5cut+0kvvGDdACvgz5rVtTfvQGlp\nKZ544gns3bsXv//97/Haa69h3rx5XbZZunQp1q9fj/Xr12PZsmVYuHAhAGDZsmWYM2cOli5diubm\nZpx//vmYMmVKXu3wAoM5EXln4kSgvh4YPRqoqQEuvhi47rqu2xx/PHDOOdb9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ATgy2\nVYCqfpq42xPWWGLg+edEJ/PLAJ6xs30QwdyoSUYi8jUAO1R1Q9BtSSUiD4jIdgDfAvD/gm5PN98B\n8NugG2GQEwHsSHn8EQwIUKYTkVpYPeE3g21JRzrjLVjzZV5V1bVBtwmdnUxbJ5ZCq1mOIiKvAjg+\n9UeJxtwDa5LR91VVReQBWJOM6txug4M2fQ/A3bBSLKnPeS7bcVLVX6vq9wB8L5F/vRnArKDblNjm\nHgCHVXWx1+2x2yYKHxGpAPACgFu7fRMNROJb55jEWNBSERmhqrbSG14Qka8A2KWqjSISg4245How\nV9XJubcCAPwUgC9/jJnaJCJnAKgF8LaICKzUwToROVtVdwfRpjQWA/gP+BDMc7VJRP4e1te+iV63\nJcnBcQrSTgBDUh4PTvyM0hCRUliB/F9UdVnQ7Umlqn8VkdUALobNXLVHvgjgayLyZQBlAPqIyC9U\n9f9meoHf1SypVRlZJxn5QVXfVdUTVHWYqg6F9fV4jNeBPBcR+XzKw8tg5RUDlag8uhPA1xIDRqYJ\nMm++FsDnRaRGRI4FcDWAnNUHPhEEP6bQ3UIAG1V1btANAQARGZhM+YpIGaxv6puDbJOq3q2qQ1R1\nGKz/T69lC+SABz3zHEyfZKQw4z/+HBE5FdZxagIwNeD2AMCPARwL4FXrSwz+oKo3BtkgEbks0a6B\nAH4jIo2qeonf7VDVNhGZBqvipwTAAlU14QS8GEAMwIDE+Eu9qv4s4DZ9EcA1ADYkctQK4O6AK9sG\nAViUqEoqAfCcqv5HgO3JCycNERFFAC8bR0QUAQzmREQRwGBORBQBDOZERBHAYE5EFAEM5kREEcBg\nTkQUAQzmREQR8P8BZXtkNoyi3UAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x22b46046080>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = np.genfromtxt('LR-testSet.csv',delimiter = ',')\n",
    "x_data = data[:,:-1]\n",
    "y_data = data[:,-1]\n",
    "\n",
    "def plot():\n",
    "    x0 = []\n",
    "    y0 = []\n",
    "    x1 = []\n",
    "    y1 = []\n",
    "    \n",
    "    for i in range(len(x_data)):\n",
    "        if y_data[i] == 0:\n",
    "            x0.append(x_data[i,0])\n",
    "            y0.append(x_data[i,1])\n",
    "        else:\n",
    "            x1.append(x_data[i,0])\n",
    "            y1.append(x_data[i,1])\n",
    "    \n",
    "    #画图\n",
    "    scatter0 = plt.scatter(x0,y0,c='b',marker='o')\n",
    "    scatter1 = plt.scatter(x1,y1,c='r',marker='x')\n",
    "    #画图例\n",
    "    plt.legend(handles = [scatter0,scatter1],labels=['label0','label1'],loc ='best')\n",
    "    \n",
    "plot()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False)"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "logistic = linear_model.LogisticRegression()\n",
    "logistic.fit(x_data,y_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXMAAAEACAYAAABBDJb9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt8VOWZB/DfGwJJSEi4RaEgSVAQEnJBFuvaUoOiq3at\n11VRu7ayslrxsloLYm1QRKm0VupKxYqt3RZ1bVewtQUUGSq2FSpOiFxiBJMAQhJFoNEQyOTZP87M\nZCYzSc7MnDm3+X0/n/kkkzkz55mT5DnvPO/lKBEBERE5W5rVARARUeKYzImIXIDJnIjIBZjMiY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TORGRC/w/PrGdYl6kRHwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x22b4556ef98>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#if scale == False:\n",
    "    #画决策边界\n",
    "#plot()\n",
    "#x_test = np.array([[-4],[3]])\n",
    "#y_test = (-logistic.intercept_ - x_test*logistic.coef_[0][0])/logistic.coef_[0][1]\n",
    "#plt.plot(x_test,y_test,'k')\n",
    "#plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "             precision    recall  f1-score   support\n",
      "\n",
      "        0.0       0.92      1.00      0.96        47\n",
      "        1.0       1.00      0.92      0.96        53\n",
      "\n",
      "avg / total       0.96      0.96      0.96       100\n",
      "\n"
     ]
    }
   ],
   "source": [
    "predictions = logistic.predict(x_data)\n",
    "\n",
    "print(classification_report(y_data,predictions))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [Root]",
   "language": "python",
   "name": "Python [Root]"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
